﻿using System;
using System.Collections.Generic;

namespace cshape_demo.util
{
    public class Print
    {
        public static void PrintArr<T>(T[] arr)
        {
            var result = "";
            foreach (var x1 in arr)
            {
                result += (x1 + ",");
            }

            if (result.Length != 0)
            {
                result = result[..^1];
            }

            Console.WriteLine("[" + result + "]");
        }
        
        public static void PrintIEnumerable<T>(IEnumerable<T> arr)
        {
            var result = "";
            foreach (var x1 in arr)
            {
                result += (x1 + ",");
            }

            if (result.Length != 0)
            {
                result = result[..^1];
            }

            Console.WriteLine("[" + result + "]");
        }
    }
}